﻿@page "/General/TemplatedLegends"
@using LiveChartsCore.SkiaSharpView.Blazor
@using LiveChartsCore;
@using LiveChartsCore.SkiaSharpView;
@using ViewModelsSamples.General.TemplatedLegends

<CartesianChart
    Series="@series"
    LegendPosition="LiveChartsCore.Measure.LegendPosition.Right"
    Legend="@CustomLegend">
</CartesianChart>

@code {
    private double[] RogerValues = new double[] { 2, 4, 6, 8, 10 };
    private double[] SusanValues = new double[] { 1, 3, 5, 7, 9 };
    private ISeries[] series;
    public CustomLegend CustomLegend { get; set; } = new();

    protected override void OnInitialized()
    {
        series = new ISeries[]
        {
            new ColumnSeries<double> { Values = RogerValues, Name = "Roger" },
            new ColumnSeries<double> { Values = SusanValues, Name = "Susan" }
        };
    }
}
